package com.hdoit.apollo.web.billing.modelconfig;
import com.hdoit.apollo.web.shop.providers.CustomerProvider;
import com.hdoit.apollo.web.shop.providers.StaffProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年04月26日 15:25:58
 * @comment
 */
public class BillingConfig extends ModelMetadataAttributeConfiguration{
    public BillingConfig(){
        this.setProperty("billingNo")
            .hasAttribute(new DisplayNameAttribute("订单号"));

        this.setProperty("customerId")
            .hasAttribute(new DisplayNameAttribute("客户"))
        	.hasAttribute(new RequiredAttribute("必填"))
        	.hasAttribute(new DropDownListAttribute(new CustomerProvider()));

        this.setProperty("typeNum")
            .hasAttribute(new DisplayNameAttribute("货物种类数"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("totalNum")
            .hasAttribute(new DisplayNameAttribute("总数量"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("billingMoney")
            .hasAttribute(new DisplayNameAttribute("订单金额(元)"));

        this.setProperty("billingState")
            .hasAttribute(new DisplayNameAttribute("订单状态"));

        this.setProperty("isDelivery")
            .hasAttribute(new DisplayNameAttribute("是否发货"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("isGathering")
            .hasAttribute(new DisplayNameAttribute("是否收款"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("paidAmount")
            .hasAttribute(new DisplayNameAttribute("已付金额"));

        this.setProperty("unpaidAmount")
            .hasAttribute(new DisplayNameAttribute("待支付"));

        this.setProperty("outstandingAmount")
            .hasAttribute(new DisplayNameAttribute("尚欠款"));

        this.setProperty("address")
            .hasAttribute(new DisplayNameAttribute("物流地址"));

        this.setProperty("isLiveReceivables")
            .hasAttribute(new DisplayNameAttribute("是否现场收款"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("isLiveCargo")
            .hasAttribute(new DisplayNameAttribute("是否现场收货"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("discount")
            .hasAttribute(new DisplayNameAttribute("整单折扣"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));
        
        this.setProperty("comment")
        .hasAttribute(new DisplayNameAttribute("备注"));
        
        this.setProperty("createUserId")
        .hasAttribute(new DisplayNameAttribute("开单人"))
    	.hasAttribute(new DropDownListAttribute(new StaffProvider()));
        
        this.setProperty("businessId")
        .hasAttribute(new DisplayNameAttribute("业务员"))
        .hasAttribute(new RequiredAttribute("必填"))
    	.hasAttribute(new DropDownListAttribute(new StaffProvider()));
        
        this.setProperty("submitUserId")
        .hasAttribute(new DisplayNameAttribute("申请修改人"))
    	.hasAttribute(new DropDownListAttribute(new StaffProvider()));
        
        this.setProperty("deliveryDate")
        .hasAttribute(new DisplayNameAttribute("交货日期"));

    }
}
